/* Copyright Rex All rights reserved. */
enyo.kind({
	name: "com.RexToy.presView",
	kind: com.RexToy.abstractCvtView,
	components:[
		{kind: "BasicScroller", components: [
			{kind: "RowGroup", components: [				
				{name: "kp", richContent: false, kind: "Input", onblur:"blur", components: [
							{className: "hint", content: $L("Kpa")}
						]},
				{name: "p", richContent: false, kind: "Input", onblur:"blur", components: [
							{className: "hint", content: $L("Pa")}
						]},
				{name: "atm", richContent: false, kind: "Input", onblur:"blur", components: [
							{className: "hint", content: $L("Atm")}
						]},
				{name: "b", richContent: false, kind: "Input", onblur:"blur", components: [
							{className: "hint", content: $L("Bar")}
						]},
				{name: "mb", richContent: false, kind: "Input", onblur:"blur", components: [
							{className: "hint", content: $L("mBar")}
						]},
				{name: "mmHg", richContent: false, kind: "Input", onblur:"blur", components: [
							{className: "hint", content: $L("mmHg")}
						]}
			]}
		]}
	],
	
	fomular: {
		"p->p": "p",
		
		"p->kp": "p/1000",
		"kp->p": "kp*1000",
		"p->atm": "p/101325",
		"atm->p": "atm*101325",
		"p->b": "p/100000",
		"b->p": "b*100000",
		"p->mb": "p/100",
		"mb->p": "mb*100",
		"p->mmHg": "p*0.0075006168",
		"mmHg->p": "mmHg*133.32237"
	},
	
	units: ["p","kp","atm","b","mb","mmHg"],
	baseUnit: "p",
	
	blur: function(sender)
	{
		if(this.isNumber(sender))
		{
			this.calc(sender.name, this.getNumber(sender));
		}
	}
});